* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  width: 380px;
  max-height: 580px;
  margin: 0;
  color: #1f2328;
  background-color: #f6f8fa;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

header {
  padding: 12px 16px;
  border-bottom: 1px solid #d0d7de;
  background-color: #fff;
}

h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

#status-summary {
  font-size: 12px;
  color: #57606a;
}

main#queue-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 8px;
  max-height: 480px;
}

.queue-item {
  background-color: #fff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  transition: background-color 0.2s;
}

.filename {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background-color: #2c974b; /* Green for progress */
  width: 0%;
  transition: width 0.1s linear;
}

.status-text {
  font-size: 12px;
  color: #57606a;
}

/* States */
.queue-item[data-status="queued"] .progress-bar-fill {
  background-color: #a1a1a1; /* Gray for queued */
}

.queue-item[data-status="downloading"] .progress-bar-fill {
  background-color: #2c974b; /* Green for downloading */
}

.queue-item[data-status="completed"] {
  background-color: #f6f8fa;
}
.queue-item[data-status="completed"] .progress-bar-fill {
  background-color: #2c974b;
  width: 100% !important;
}

.queue-item[data-status="error"] .progress-bar-fill {
  background-color: #d73a49; /* Red for error */
  width: 100% !important;
}
.queue-item[data-status="error"] .status-text {
  color: #d73a49;
  font-weight: 500;
}

footer {
  padding: 8px 16px;
  border-top: 1px solid #d0d7de;
  text-align: right;
}

#clear-completed {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #d0d7de;
  background-color: #f6f8fa;
  cursor: pointer;
  transition: background-color 0.2s;
}

#clear-completed:hover {
  background-color: #e9ecef;
}

#clear-completed:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
